<template>
	<view class="msg">
		<image src='https://www.ahlinghui.com/Uploads/image/20190429/images/Report.png?1' mode='widthFix' class='response'></image>
		<view class="container" style="">
			<view class="showTypeContainer_new2">
				<view bindtap='bindviewzl' class="grid_cell_new2" style="width:33.3%;">
					<image src="https://www.ahlinghui.com/Uploads/image/20190429/images/Sale_chart.png?1"></image>
					<view class="grid_cell_new_text2">销售分析</view>
				</view>
				<view bindtap='bindviewxx' class="grid_cell_new2" data-link="message_counter2.html" style="width:33.3%;">
					<image src="https://www.ahlinghui.com/Uploads/image/20190429/images/Administrative_Tools_48px.png?1"></image>
					<view class="grid_cell_new_text2">生产分析</view>
				</view>
				<view bindtap='bindviewsm' class="grid_cell_new2" style="width:33.3%;">
					<image src="https://www.ahlinghui.com/Uploads/image/20190429/images/Stock_48px.png?1"></image>
					<view class="grid_cell_new_text2">仓库分析</view>
				</view>
				<view bindtap='bindviewaw' class="grid_cell_new2" style="width:33.3%;">
					<image src="https://www.ahlinghui.com/Uploads/image/20190429/images/analytics_48px.png?1"></image>
					<view class="grid_cell_new_text2">财务分析</view>
				</view>
				<view bindtap='bindviewaa' class="grid_cell_new2" style="width:33.3%;">
					<image src="https://www.ahlinghui.com/Uploads/image/20190429/images/OA_64px.png?1"></image>
					<view class="grid_cell_new_text2">{{user}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: 'oa分析'
			}
		},
		mounted() {
			var res = global.isLogin();
			if (!res) {
				uni.showModal({
					title: '请登录',
					content: "请登录",
					showCancel: false
				})
			}
			uni.login({
				provider: 'weixin',
				success: function(loginRes) {
					console.log(loginRes.authResult);
					this.user = loginRes.authResult
					// 获取用户信息
					uni.getUserInfo({
						provider: 'weixin',
						success: function(infoRes) {
							console.log('用户昵称为：' + infoRes.userInfo.nickName);
							this.user = infoRes.userInfo.nickName
						}
					});
				}
			});
		},
	}
</script>

<style lang="scss">
	.showTypeContainer_new2 {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		width: 100%;
		flex-wrap: wrap;
		padding-bottom: 20upx;

		.grid_cell_new2 {
			position: relative;
			box-sizing: border-box;
			padding: 60upx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			font-size: small;
		}

	}


	.grid_cell_new2 image {
		width: 100upx;
		height: 100upx;
	}

	.grid_cell_new_text2 {
		margin-top: 20upx;
		color: #000;
		font-size: 28upx;
	}

	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}
</style>
